/**
 * @file wa_editline.h
 *
 */

#ifndef _WA_EDITLINE_H
#define _WA_EDITLINE_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
*      INCLUDES
*********************/
#include "wa_conf.h"
#if USE_WA_EDITLINE != 0
#include <string.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include "wa_area.h"
#include "wa_obj.h"
#include "wa_mask_draw.h"
#include "wa_wm.h"
#include "wa_font.h"
#include "wa_image.h"
#include "wa_malloc.h"
/*********************
*      DEFINES
*********************/

#define WA_EDITLINE_AL_LEFT         (0<<0)
#define WA_EDITLINE_AL_RIGHT        (1<<0)
#define WA_EDITLINE_AL_HCENTER      (2<<0)

#define WA_EDITLINE_AL_TOP          (0<<2)
#define WA_EDITLINE_AL_BOTTOM       (1<<2)
#define WA_EDITLINE_AL_VCENTER      (2<<2)

/**********************
*      TYPEDEFS
**********************/

typedef struct
{
	int32_t focus;
	char* text;
	wa_font* font;
	uint8_t row_space;
	uint8_t col_space;
	wa_gui_color fore_color;
	wa_gui_color back_color;
	uint8_t align_mode;
}wa_editline_ext;

/**********************
* GLOBAL PROTOTYPES
**********************/
void wa_editline_module_init(void);
wa_obj* wa_editline_create(wa_obj* par);
void wa_editlint_set_focus(wa_obj* editline, int32_t focus);
int32_t wa_editline_get_focus(wa_obj* editline);
int32_t wa_editline_get_focus_size(wa_obj* editline);
int32_t wa_editline_get_focus_letter_offset(wa_obj* editline);
uint32_t wa_editline_get_focus_letter(wa_obj* editline);
void wa_editline_set_text(wa_obj* editline, char* text);
int32_t wa_editline_get_text(wa_obj* editline, char* text, uint32_t size);
void wa_editline_set_row_space(wa_obj* editline, uint8_t row_space);
uint8_t wa_editline_get_row_space(wa_obj* editline);
void wa_editline_set_col_space(wa_obj* editline, uint8_t col_space);
uint8_t wa_editline_get_col_space(wa_obj* editline);
void wa_editline_set_font(wa_obj* editline, wa_font* font);
wa_font* wa_editline_get_font(wa_obj* editline);
void wa_editline_set_fore_color(wa_obj* editline, wa_gui_color color);
wa_gui_color wa_editline_get_fore_color(wa_obj* editline);
void wa_editline_set_back_color(wa_obj* editline, wa_gui_color color);
wa_gui_color wa_editline_get_back_color(wa_obj* editline);
void wa_editline_set_align_mode(wa_obj* editline, uint8_t align_mode);
uint8_t wa_editline_get_align_mode(wa_obj* editline);

/**********************
*      MACROS
**********************/

#endif

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif


